public class Work2 {
    public static int fac(int n) {
        if (n == 1)
            return 1;
        else
            return n * fac(n - 1);
    }

    public static void main(String[] args) {
        //求 N 的阶乘   阶乘还有一题递归实现一样
        int n = 5;
        System.out.println(fac(n));
    }
}
